from django.core.management.base import BaseCommand
from apps.myauth.models import Department


class Command(BaseCommand):
    def handle(self, *args, **options):
        # 初始化部门数据
        Department.objects.all().delete()
        boarder = Department.objects.create(name='教务处', intro="教务处")
        developer = Department.objects.create(name='210701', intro="210701")
        operator = Department.objects.create(name='210702', intro="210702")
        saler = Department.objects.create(name='210703', intro="210703")
        hr = Department.objects.create(name='210704', intro="210704")
        finance = Department.objects.create(name='210705', intro="210705")
        self.stdout.write('部门数据初始化成功！')